#include <bits/stdc++.h>
using namespace std;
int t,a[100001],c[100001];
int main(){
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    scanf("%d",&t);
    while(t--){
        int n,m;
        scanf("%d%d",&n,&m);
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
        }
        for(int i=1;i<=m;i++){
            scanf("%d",&c[i]);
        }
        printf("1\n");
    }
    return 0;
}
